﻿<Frame x:Class="StockManagement.Views.MaterialGrid"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008">
    <Frame.Resources>
        <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter1" />
    </Frame.Resources>
    <Frame.Content>
        <Grid Grid.Column="1" Grid.RowSpan="3" x:Name="_mainGrid">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="*"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
            </Grid.RowDefinitions>
            <!--<StackPanel Orientation="Horizontal" Margin="5" Visibility="Visible">
                <RadioButton x:Name="rdAllMat" x:Uid="rdall" GroupName="grid" Margin="5" Checked="RadioButton_Checked">All Materials</RadioButton>
                <RadioButton x:Name="rdmanf" x:Uid="rdmanf"  GroupName="grid" Margin="5" Checked="RadioButton_Checked">Manufacturing</RadioButton>
                <RadioButton x:Name="rddprod" x:Uid="rddprod"  GroupName="grid" Margin="5" Checked="RadioButton_Checked">Product</RadioButton>
                
            </StackPanel>-->

            <StackPanel Orientation="Horizontal" Margin="5" Visibility="Collapsed">
                <Label Margin="2" Padding="3" Content="Material Type" Height="23"></Label>
                <ComboBox x:Name="cmbShowMaterialsDG" IsEditable="False" MinWidth="80" Margin="2" 
                              ItemsSource="{Binding Source={StaticResource dgShowMaterials}}" 
                               SelectedItem="{Binding Path=ShowMaterial}"
                              VerticalAlignment="Center" HorizontalAlignment="Stretch" Padding="3">
                </ComboBox>
            </StackPanel>
            
            <StackPanel Grid.Row="2">
                <Button Command="{Binding Path=ExportToExcelCommand}">Get Report</Button>
            </StackPanel>
            <DataGrid x:Name="_datagridMaterials"  Grid.Row="1" ItemsSource="{Binding Path=MaterialCollection, NotifyOnSourceUpdated=True}" >
                <DataGrid.Columns>
                    <DataGridTextColumn Header="Material Name" Binding="{Binding Path=MaterialName}" IsReadOnly="True" />
                    <DataGridTextColumn Header="Material Code" Binding="{Binding Path=MaterialCode}" IsReadOnly="True"/>
                    <DataGridTextColumn Header="Material Type" Binding="{Binding Path=MaterialType}" IsReadOnly="True" Visibility="Collapsed"/>
                    <DataGridTextColumn Header="Vendor" Binding="{Binding Path=Vendor}" IsReadOnly="True"  Visibility="Collapsed"/>
                    <DataGridTextColumn Header="Material Rate" Binding="{Binding Path=MaterialRate}" IsReadOnly="True" Visibility="Collapsed"/>
                    <DataGridTextColumn Header="Material Quantity" Binding="{Binding Path=Quantity}" IsReadOnly="True"/>
                    <DataGridTextColumn Header="VAT" Binding="{Binding Path=MaterialVAT}" IsReadOnly="True" Visibility="Collapsed"/>
                    <DataGridTextColumn Header="Total Price" Binding="{Binding Path=TotalPrice}" IsReadOnly="True" Visibility="Collapsed"/>
                    <DataGridTextColumn x:Name="colPurchaser" Header="Purchaser" Binding="{Binding Path=Purchaser}" IsReadOnly="True"  Visibility="Collapsed" />
                    <DataGridTextColumn Header="Updated Date" Binding="{Binding Path=Date, StringFormat={}{0:dd-MMM-yyyy}}" IsReadOnly="True" Visibility="Collapsed"/>
                </DataGrid.Columns>
            </DataGrid>
        </Grid>
    </Frame.Content>
</Frame>
